package com.hzsd.zengbanyi.biaodan_text.bean;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class WorkBaseHelper extends SQLiteOpenHelper {
	private final static String  sql="create table if not exists media (media_path varchar(20) ,task_scene_id varchar(20),media_type int(20))";
	private final static String  sql2="create table if not exists signature (task_scene_id varchar(20) PRIMARY KEY,signature_path varchar(20),signature_imgpath varchar(20))";
	private final static String  sql3="create table if not exists isupload (task_id varchar(20),state varchar(5))";

	public WorkBaseHelper(Context context) {
		super(context, "work.db", null, 4);
		// TODO Auto-generated constructor stub
	} 
	@Override
	public void onCreate(SQLiteDatabase db) {
		System.out.println("onCreate...");
		db.execSQL(sql);
		db.execSQL(sql2);
		db.execSQL(sql3);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		System.out.println("onUpgrade...");
		db.execSQL("DROP TABLE IF EXISTS media");  
		db.execSQL("DROP TABLE IF EXISTS signature"); 
		db.execSQL("DROP TABLE IF EXISTS isupload");
        onCreate(db); 

	}

}
